home *** CD-ROM | disk | FTP | other *** search
- /* first, the mandatory includes */
- #include <types.h>
- #include <quickdraw.h>
- #include <resources.h>
- #include <fonts.h>
- #include <windows.h>
- #include <menus.h>
- #include <textedit.h>
- #include <events.h>
-
- /* declarations */
- void DoDrawSize();
- void DoGrow();
- void DoCalcRgns();
- long int DoHit();
- void DoDraw();
-
- /*---------------------- Main Proc within WDEF ----------------------*/
- pascal long int MyWindowDef(varCode,theWindow,message,param)
- short int varCode;
- WindowPtr theWindow;
- short int message;
- long int param;
-
- { /* MyWindowDef */
-
- Rect *aRectPtr;
- long int theResult=0; /*this is what the function returns, init to 0 */
-
- switch (message)
- {
- case wDraw: /* draw window frame*/
- DoDraw(theWindow,param);
- break;
- case wHit: /* tell what region the mouse was pressed in*/
- theResult = DoHit(theWindow,param);
- break;
- case wCalcRgns: /* calculate structRgn and contRgn*/
- DoCalcRgns(theWindow);
- break;
- case wNew: /* do any additional initialization*/
- break; /* nothing here */
- case wDispose: /* do any additional disposal actions*/
- break; /* we don't need to do any*/
- case wGrow: /* draw window's grow image*/
- aRectPtr = (Rect *)param;
- DoGrow(theWindow,*aRectPtr);
- break;
- case wDrawGIcon: /* draw Size box in content region*/
- DoDrawSize(theWindow);
- break;
- } /* switch */
- return theResult;
- } /* MyWindowDef */
-
- /* here are the routines that are dispatched to by MyWindowDef */
-
- /*--------------------------- DoDraw function -----------------------------*/
- void DoDraw(WindToDraw,DrawParam)
- WindowPtr WindToDraw;
- long int DrawParam;
-
- { /* DoDraw */
- /* code for DoDraw goes here */
- } /* DoDraw */
-
- /*--------------------------- DoHit function -----------------------------*/
- long int DoHit(WindToTest,theParam)
- WindowPtr WindToTest;
- long int theParam;
-
- { /* DoHit */
- /* code for DoHit goes here */
- } /* DoHit */
-
- /*------------------------ DoCalcRgns procedure --------------------------*/
- void DoCalcRgns(WindToCalc)
- WindowPtr WindToCalc;
-
- { /* DoCalcRgns */
- /* code for DoCalcRgns goes here */
- } /* DoCalcRgns */
-
- /*-------------------------- DoGrow procedure ----------------------------*/
- void DoGrow(WindToGrow,theGrowRect)
- WindowPtr WindToGrow;
- Rect theGrowRect;
-
- { /* DoGrow */
- /* code for DoGrow goes here */
- } /* DoGrow */
-
- /*------------------------ DoDrawSize procedure --------------------------*/
- void DoDrawSize(WindToDraw)
- WindowPtr WindToDraw;
-
- { /* DoDrawSize */
- /* code for DoDrawSize goes here */
- } /* DoDrawSize */
-